function setupWebViewJavascriptBridge(callback) {
    //alert("进入了setupWebViewJavascriptBridge()");
    if (window.WebViewJavascriptBridge) {
        alert("提示：window.WebViewJavascriptBridge");
        return callback(window.WebViewJavascriptBridge)
    }
    if (window.WKWVJBCallbacks) { return window.WKWVJBCallbacks.push(callback); }
    window.WKWVJBCallbacks = [callback];
    window.webkit.messageHandlers.iOS_Native_InjectJavascript.postMessage(null)
}
export default {
    callhandler(name, data, callback) {
        //alert("进入了callHandler()");
        setupWebViewJavascriptBridge(function(bridge) {
            bridge.callHandler(name, data, callback)
        })
    },
    registerhandler(name, callback) {
        //alert("进入了registerhandler()");
        setupWebViewJavascriptBridge(function(bridge) {

            bridge.registerHandler(name, function(data, responseCallback) {
                callback(data, responseCallback)
            })
        })
    }
}